home *** CD-ROM | disk | FTP | other *** search
- /****i* SOURCE_FILE/INFO
- *
- * NAME
- * PropertyResourceBundle.js
- *
- * USAGE
- * Part of Netobjects JavaScript Library.
- *
- * COPYRIGHT
- * Copyright ⌐ 2000-2005 Website Pros, Inc.
- * All Rights Reserved.
- *
- * This is an unpublished work protected by Website Pros, Inc.
- * as a trade secret, and is not to be used or disclosed except as
- * expressly provided in a written license agreement executed by
- * you and Website Pros, Inc.
- *
- * <copyright@websitepros.com>
- *
- * NOTES
- * JavaScript code.
- *
- *****/
-
- if (!IS.isModuleInitialized("IS.NOF.UTIL.PropertyResourceBundle"))
- {
-
- /****h* NOF_JavaScript_Library/NOF.UTIL.PropertyResourceBundle
- *
- * NAME
- * NOF.UTIL.PropertyResourceBundle
- *
- * DESCRIPTION
- * PropertyResourceBundle manages resources using a set of static strings.
- * See ResourceBundle for more information about resource bundles.
- *
- ****/
-
- /**
- * Constructor
- */
- function UTIL_PropertyResourceBundle(id){
- this.__proto__ = UTIL_PropertyResourceBundle.prototype;
-
- this._ID = id;
- this.hash = new Array();
-
- }
- {
- var method = UTIL_PropertyResourceBundle.prototype;
- /**
- * Return the id attached to this set of strings.
- **/
- method.getID = function () {
- return ("" + this._ID);
- }
-
-
- /**
- * Return the keys for this string table
- **/
- method.getKeys = function () {
- var q = [];
- var i = 0;
- for (var u in this.hash){
- if (typeof(this.hash[u])!="function") {
- q[i] = u;
- i++;
- }
- }
- return q;
- }
-
- /**
- * Return the values for this string table
- **/
- method.getValues = function () {
- var q = [];
- var i = 0;
- for (var u in this.hash) {
- if (typeof(this.hash[u]) != "function") {
- q[i] = this.hash[u];
- i++;
- }
- }
- return q;
- }
-
- /**
- * Return the value as a JavaScript String object (not equal to a javascript string)
- * assigned to 'key' or null if 'key' not found.
- **/
- method.getProperty = function ( /*string*/ key ) {
- return this.getString( key );
- }
-
- /**
- * Set the value for this key to 'value'.
- **/
- method.setProperty = function ( /*string*/ key, /*string*/ value ) {
- this.hash[key] = value;
- }
-
- /**
- * Return the value as a JavaScript String object (not equal to a javascript string)
- * assigned to 'key' or null if 'key' not found.
- **/
- method.getString = function (/*string*/ key) {
- val = this.getObject(key);
- if (val != null) {
- return new String(val);
- }
- return null;
- }
-
- method.handleGetObject = function ( key ) {
- return this.getObject( key );
- }
-
- // private method
- method.getObject = function (key){
- return this.hash[key];
- }
- }
-
- UTIL.__proto__.PropertyResourceBundle = UTIL_PropertyResourceBundle;
- }